<?php
class ESDBException extends CException {
	/**
	 * @var string ESDB error status
	 */
	public $status;
	function __construct($status, $message, $code=0) {
		$this->status = $status;
		if (is_array($message)) {
			$messages = array();
			foreach ($message as $error) {
				$messages[] = @$error['message'];
			}
			$message = implode(',',@$messages);
		}
		$message = Yii::t('yii','{status}: {message}',
				array('{status}'=>$status,'{message}'=>$message));
		return parent::__construct($message,$code);
	}
	
}
